create external table jms_ods.yl_oms_dispatch_waybill(
id                              bigint        comment  '主键id'
,waybill_no                     string        comment  '运单号'
,dispatch_network_code          string        comment  '派件网点code'
,dispatch_network_name          string        comment  '派件网点名称'
,dispatch_finance_code          string        comment  '派件财务中心code'
,dispatch_finance_name          string        comment  '派件财务中心名称'
,franchisee_code                string        comment  '加盟商code'
,franchisee_name                string        comment  '加盟商名称'
,dispatch_time                  timestamp     comment  '派件时间'
,dispatch_staff_code            string        comment  '派件业务员code'
,dispatch_staff_name            string        comment  '派件业务员名称'
,contracting_area_code          string        comment  '承包区code'
,contracting_area_name          string        comment  '承包区名称'
,dispatch_staff_type_code       tinyint       comment  '派件业务员类型code'
,dispatch_code                  string        comment  '派件方式code'
,dispatch_name                  string        comment  '派件方式名称'
,sender_province_id             bigint        comment  '寄件省份id'
,sender_province_name           string        comment  '寄件省份名称'
,sender_city_id                 bigint        comment  '寄件城市id'
,sender_city_name               string        comment  '寄件城市名称'
,receiver_customer_code         string        comment  '收件客户code'
,receiver_customer_name         string        comment  '收件客户名称'
,receiver_name                  string        comment  '收件人姓名'
,receiver_mobile_phone          string        comment  '收件人手机号'
,receiver_telphone              string        comment  '收件人座机'
,receiver_province_id           bigint        comment  '收件省份id'
,receiver_province_name         string        comment  '收件省份名称'
,receiver_city_id               bigint        comment  '收件城市id'
,receiver_city_name             string        comment  '收件城市名称'
,receiver_detailed_address      string        comment  '收件详细地址'
,is_sign                        tinyint       comment  '签收标识：0未签收，1正常签收，2退件签收'
,sign_time                      timestamp     comment  '签收时间'
,sign_network_code              string        comment  '签收网点code'
,sign_network_name              string        comment  '签收网点名称'
,sign_finance_code              string        comment  '签收财务中心code'
,sign_finance_name              string        comment  '签收财务中心名称'
,collect_settlement_code        string        comment  '到付结算方式编码'
,settlement_code                string        comment  '结算方式编码'
,fee_cost                       double        comment  '账单金额'
,payment_amount                 double        comment  '预付款交易金额'
,receive_pay_fee                double        comment  '到付费'
,fee_type_code                  string        comment  '费用类型code'
,settlement_weight              double        comment  '结算重量'
,charge_weight                  double        comment  '计费重量'
,charge_weight_source           tinyint       comment  '计费重量来源'
,is_verifier                    tinyint       comment  '审核标识：1是，0否'
,verifier_time                  timestamp     comment  '审核时间'
,verifier_code                  string        comment  '审核人code'
,verifier_name                  string        comment  '审核人名称'
,goods_type_code                string        comment  '物品类型code'
,goods_type_name                string        comment  '物品类型名称'
,express_type_code              string        comment  '产品类型code'
,express_type_name              string        comment  '产品类型名称'
,origin_code                    string        comment  '始发地code'
,origin_name                    string        comment  '始发地名称'
,destination_code               string        comment  '目的地code'
,destination_name               string        comment  '目的地名称'
,is_need_receipt                tinyint       comment  '是否需要需要签回单,1是，0否'
,receipt_no                     string        comment  '回单号/原单号'
,is_abnormal                    tinyint       comment  '问题件标识：1是，0否'
,abnormal_code                  string        comment  '问题件原因code'
,abnormal_name                  string        comment  '问题件原因名称'
,is_business                    tinyint       comment  '是否是商务件：1是，2否'
,is_refund                      tinyint       comment  '是否退件：0未退件，1已退件，2已转寄'
,calculate_fee_code             int           comment  '算费描述code'
,calculate_fee_desc             string        comment  '算费描述'
,remarks                        string        comment  '备注'
,miss_flag                      tinyint       comment  '是否残缺：1是、0否'
,is_delete                      tinyint       comment  '是否删除：1是、0否'
,source_code                    int           comment  '来源编码'
,version                        bigint        comment  '版本号'
,create_time                    timestamp     comment  '创建时间'
,update_time                    timestamp     comment  '更新时间'
,update_by                      string        comment  '更新人code/name'
,receive_pay_amount             double        comment  '到付费交易金额'
,receiver_area_id               bigint        comment  '收件区域id'
,receiver_area_name             string        comment  '收件区域名称'
,terminal_dispatch_code         string        comment  '三段码'
,waybill_input_time             timestamp     comment  '寄件运单录入时间'
)
    comment '派件运单表'
    partitioned by (dt string comment '更新日期 (yyyy-mm-dd)')
    stored as parquet
    location '/dw/hive/jms_ods.db/external/yl_oms_dispatch_waybill'
    tblproperties (
        'parquet.column.index.access' = 'true'
        );